from django.urls import path
from . import views

app_name = 'game_core'

urlpatterns = [
    # 主页和基础功能
    path('', views.game_home, name='home'),
    path('start/', views.start_game, name='start_game'),
    path('continue/<int:session_id>/', views.continue_game, name='continue_game'),
    path('upgrade/', views.character_upgrade, name='upgrade'),
    path('battle/<int:session_id>/', views.battle_view, name='battle'),
    
    # 爬塔系统
    path('tower/', views.tower_view, name='tower'),
    path('tower/floor/<int:floor_id>/', views.floor_view, name='floor'),
    path('battle/<int:floor_id>/', views.battle_view, name='battle'),
    path('shop/<int:floor_id>/', views.shop_view, name='shop'),
    path('treasure/<int:floor_id>/', views.treasure_view, name='treasure'),
    path('rest/<int:floor_id>/', views.rest_view, name='rest'),
    
    # 角色升级和管理
    path('upgrade/', views.character_upgrade, name='upgrade'),
    path('upgrade/stat/', views.upgrade_stat, name='upgrade_stat'),
    path('upgrade/skill/', views.upgrade_skill, name='upgrade_skill'),
    
    # 技能管理
    path('skills/', views.skill_shop, name='skill_shop'),
    path('skills/equip/<int:skill_id>/', views.equip_skill, name='equip_skill'),
    path('skills/unequip/<int:skill_id>/', views.unequip_skill, name='unequip_skill'),
    path('skills/learn/', views.learn_skill, name='learn_skill'),
    
    # 存档管理
    path('save/', views.save_game, name='save_game'),
    path('load/', views.load_game, name='load_game'),
    
    # API端点
    path('api/battle/attack/', views.battle_attack, name='battle_attack'),
    path('api/battle/use_skill/', views.battle_use_skill, name='battle_use_skill'),
    path('api/shop/buy/', views.shop_buy_item, name='shop_buy'),
    path('battle/attack/', views.battle_attack, name='battle_attack'),
    path('battle/skill/', views.battle_use_skill, name='battle_use_skill'),
] 